package edu.pku.sei.transformation.editor.actions;

import org.eclipse.jface.action.Action;

import edu.pku.sei.transformation.editor.model.requirement.Description;
import edu.pku.sei.transformation.editor.model.requirement.TransformationGoal;

public class CreateDescriptionAction extends Action {
	private TransformationGoal goal;
	CreateDescriptionAction(TransformationGoal goal) {
		this.setText("Add Description");
		this.goal = goal;
	}
	
	@Override
	public void run() {
		Description description = new Description();
		description.setSummary("end description");
		GoalDescriptionDialog dialog = new GoalDescriptionDialog();
		dialog.setDeleteable(false);
		dialog.setDescription(description);
		int result = dialog.open();
		if (result == GoalDescriptionDialog.OK) {
			goal.getEndDescription().add(description);
		} else {

		}
		
	}
}
